package internal

import (
	"context"

	fpyDcsDb "gf/fpy/dcs/db"
)

func init() {
	fpyDcsDb.SetSoPath("./fpy/dcs/db/.so/db.so")
	fpyDcsDb.SetDbUrl("http://192.168.8.101:11001")
	fpyDcsDb.SetDbSid("0ao6")
}

type CmsArticleDao struct {
	sid 	string
	dbSid   string
	projectSid 	string
	table   string
	group   string
	columns TCmsArticleColumns
}

type TCmsArticleColumns struct {
    Sid    string
    AddTime    string
    UpdateTime    string
    IsDel    string
    CategorySid    string
    Hits    string
    ModuleSid    string
    PublishState    string
    PublishTime    string
    Sort    string
}


var cCmsArticleColumns = TCmsArticleColumns{
    Sid:    "sid",
    AddTime:    "add_time",
    UpdateTime:    "update_time",
    IsDel:    "is_del",
    CategorySid:    "category_sid",
    Hits:    "hits",
    ModuleSid:    "module_sid",
    PublishState:    "publish_state",
    PublishTime:    "publish_time",
    Sort:    "sort",
}

func NewCmsArticleDao() *CmsArticleDao {
	return &CmsArticleDao{
		sid: 	"0apb",
		dbSid:	"0ao6",
		projectSid:	"dbd3",
		group:   "cms",
		table:   "article",
		columns: cCmsArticleColumns,
	}
}

func (dao *CmsArticleDao) Columns() TCmsArticleColumns {
	return dao.columns
}

func (dao *CmsArticleDao) Group() string {
	return dao.group
}

func (dao *CmsArticleDao) Table() string {
	return dao.table
}

func (dao *CmsArticleDao) Ctx(ctx context.Context) *fpyDcsDb.TDb {
	return fpyDcsDb.Ctx(ctx).Table(dao.sid).FpyProjectSid(dao.projectSid)
}